<!DOCTYPE HTML>
<html>
<head th:include="/common/head :: head"></head>
<style>
	.row-fluid{
		max-width: 1024px;
    	/* margin: 0 auto; */
	}
	.table th{
		font-size: 24px;
		font-weight: bold;
	}
	.detailTable tbody td:nth-child(1),td:nth-child(3){
		text-align:left;
		min-width:150px;
		
	}
	.table td{
		font-size: 16px;
		font-family: Microsoft YaHei;
	}

</style>
<body class="pos-r">
	<div>

		<nav class="breadcrumb" th:include="/common/navbar :: navbar('用户管理','个人活动信息')"></nav>

		<form action="/activity/user/save" method="post" class="form form-horizontal" id="saveActivity">
			<div class="container-fluid">
				<div class="row-fluid">
				
				<table class="table table-hover detailTable">
					<thead>	
						<tr>
							<th colspan="4"> 基本信息 </th>
						</tr>
					</thead>
					<tbody>
					<input type="hidden" id="id" name="id" th:value="${entity.id}" />
						<tr>
							<td>账号:</td><td th:text="${entity.userCode}"></td>
							<td>&nbsp;</td><td>&nbsp;</td>
						</tr>
						<tr>
							<td>姓名:</td>
							<td >
							<input type="text" maxlength="20" class="input-text" th:value="${entity.name}" placeholder="姓名" id="name" name="name" />
							</td>
							<td>地址:</td>
							<td th:include="/common/fromtag :: areaselect('活动区域',${entity.province},${entity.city},${entity.district})"></td>
						</tr>
						<tr>
							<td>手机号:</td>
							<td >
							<input type="text" maxlength="20" class="input-text" th:value="${entity.mobile}" placeholder="手机号" id="mobile" name="mobile" />
							</td>
							<td>公司</td>
							<td >
							<input type="text" maxlength="20" class="input-text" th:value="${entity.company}" placeholder="公司" id="company" name="company" />
							</td>
						</tr>
						<tr>
							<td>邮箱:</td>
							<td >
							<input type="text" maxlength="20" class="input-text" th:value="${entity.company}" placeholder="邮箱" id="email" name="email" />
							</td>
							<td>职务:</td>
							<td >
							<input type="text" maxlength="20" class="input-text" th:value="${entity.position}" placeholder="职务" id="position" name="position" />
							</td>
						</tr>
						<tr>
							<td>擅长领域:</td>
							<td>
							<input type="text" maxlength="20" class="input-text" th:value="${entity.adeptField}" placeholder="擅长领域" id="adeptField" name="adeptField" />
							</td>
							<td>著作:</td>
							<td >
							<textarea class="textarea radius"  id="writings" name="writings" th:utext="${entity.writings}"></textarea> 
							</td>
						</tr>
						<tr>
							<td>荣誉:</td>
							<td >
							<textarea class="textarea radius"  id="honor" name="honor" th:utext="${entity.honor}">${entity.honor}</textarea>
							</td>
							<td>能力/经验:</td>
							<td >
							<textarea class="textarea radius"  id="intro" name="intro" th:utext="${entity.intro}">${entity.intro}</textarea>
							</td>
						</tr>
						<tr>
						<td colspan="4" style="text-align:center;">
								<button onclick="dosubmit();" type="button" class="btn btn-primary radius" ><i class="Hui-iconfont">&#xe632;</i> 保存</button>
							</td>
							<td colspan="4" style="text-align:center;">
								<button onClick="toBack();"  class="btn btn-primary radius" ><i class="Hui-iconfont">&#xe66b;</i> 返回 </button>
							</td>
						</tr>
					</tbody>
				</table>
			
			
				<table class="table table-hover detailTable">
					<thead>	
						<tr> <th colspan="4"> 系统信息 </th> </tr>
					</thead>
					<tbody>
						<tr>
							<td>用户类型:</td><td th:text="${entity.user != null} ? ${entity.user.userType.value} :  '' "></td>
							<td>注册时间:</td><td th:text="${entity.user != null ? #dates.format(entity.user.registrationTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td>
						</tr>
<!-- 						<tr> -->
<!-- 							<td>注册时间:</td><td th:text="${entity.user != null ? #dates.format(entity.user.registrationTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td> -->
<!-- 							<td>入会审核时间：</td><td th:text="${member!=null and member.auditTime != null ? #dates.format(member.auditTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td> -->
<!-- 						</tr> -->
<!-- 						<tr> -->
<!-- 							<td>入会审核人员:</td><td th:text="${member!=null?member.auditUser:''}"></td> -->
<!-- 							<td>入会说明：</td><td th:text="${member!=null?member.auditDescription:''} "></td> -->
<!-- 						</tr> -->
					</tbody>
				</table>
				
				
				<table class="table table-hover detailTable">
					<thead>	
						<tr> <th colspan="4"> 活动信息 </th> </tr>
					</thead>
					<tbody>
						<tr>
<!-- 							<td>活动审核人员：</td><td th:text="${entity.auditUser}"></td> -->
							<td>报名时间：</td><td th:text="${entity.applicationTime != null ? #dates.format(entity.applicationTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td>
						</tr>
<!-- 						<tr> -->
<!-- 							<td>活动审核说明：</td><td th:text="${entity.auditDescription}"></td> -->
<!-- 							<td>活动审核时间：</td><td th:text="${entity.auditTime != null ? #dates.format(entity.auditTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td> -->
<!-- 						</tr> -->
<!-- 						<tr> -->
<!-- 							<td>取消活动备注：</td><td th:text="${entity.cancelReason}"></td> -->
<!-- 							<td>取消活动时间：</td><td th:text="${entity.cancelTime != null ? #dates.format(entity.cancelTime, 'yyyy-MM-dd HH:mm:ss') : ''}"></td> -->
<!-- 						</tr> -->
					</tbody>
				</table>
					
			</div>
		</div>
		</form>
	</div>

	<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
	<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script> 


<script type="text/javascript">

function dosubmit(){
	if($("#saveActivity").validate().form()){
		$('#saveActivity').submit();
	}
}

$(function(){
	//表单验证方法
	$("#saveActivity").validate({
		rules:{
			name:{
				required:true,
				stringCheck:true
			},
			mobile:{
				required:true
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
		        type: "post",
		        beforeSend: function () {
		        	$('.btn').attr('disabled',true);
			    },
		        dataType: "json",
		        success: function(data){
		        	alert("修改成功!");
		        	window.location.replace("/activity/user/update?id="+$("#id").val());
		        }
		    });
			
			
		}
	});
})
</script>
</body>
</html>